<?php

class UserScheduleController extends Controller
{


	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
			'accessControl', // perform access control for CRUD operations
			'postOnly + delete', // we only allow deletion via POST request
		);
	}


	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(
			array('allow', // allow admin user to perform the following actions
				'actions'=>array('index','admin','delete','create','update','renderUserSchedule'),
				'expression'=>'$user->can_create_edit_shifts == 1',
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
		);
	}

	/**
	 * Lists all models.
	 */
	public function actionIndex()
	{
		//$user=User::model()->findByAttributes(array('username'=>$this->username));
        $this->render('index');		
	}

   public function actionRenderUserSchedule()
    {
		$data = '';
        //$this->renderPartial('//role/admin', $data, false, true);
        //$this->render('/schedule/view/'.$iduser);
		//$this->redirect(array('/schedule/view', 'id'=>$iduser));
    }
	
}